from HomeWork_PO_Apptest_add_and_delete_members.base.base_page import BasePage
from HomeWork_PO_Apptest_add_and_delete_members.page.addmember_page import AddMemberPage
from HomeWork_PO_Apptest_add_and_delete_members.page.search_member_page import SearchMemberPage


class AddressListPage(BasePage):
    def click_addmember(self):
        #如果页面联系人很多，需要滑动页面才能找到“添加成员”按钮
        self.driver.find_element_by_android_uiautomator('new UiScrollable(new UiSelector().'
                                                        'scrollable(true).instance(0)).'
                                                        'scrollIntoView(new UiSelector().text("添加成员").instance(0))').click()
        return AddMemberPage(self.driver)
    def click_search(self):
        #点击并点击搜索图标
        self.driver.find_element_by_android_uiautomator('new UiSelector().resourceId("com.tencent.wework:id/j3d")').click()

        return SearchMemberPage(self.driver)
    #def input_search_name(self):
        #在输入框输入要删除的用户名
